package com.cloudkinto.controller.user;


import com.cloudkinto.base.BaseController;
import com.cloudkinto.common.annotations.UserSessionRequired;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.user.UserService;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 张永远
 * @since 2020-05-27
 */
@RestController
@Api(tags = "用户模块")
@RequestMapping("/api/admin/user")
public class UserUtilController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(UserUtilController.class);

    @Autowired
    private UserService service;

    @GetMapping("verificationCode")
    @ApiOperation(value = "获取验证码", notes = "")
    public SingleResult verificationCode(HttpServletRequest request, HttpServletResponse response) throws IOException {
        return service.verificationCode();
    }


    @UserSessionRequired
    @GetMapping("getHeaderUrl")
    @ApiOperation(value = "获取项目头像", notes = "获取项目头像")
//    @ApiResponses(@ApiResponse(code = 200, message = "", response = UserInfoRes.class))
    public SingleResult getHeaderUrl(String type) {
        return SingleResult.success("", service.getHeaderUrl(type));
    }



}

